<template>
  <div class="homeContainer">
    <qn-header></qn-header>
    <swiper :swiperlist="swiperlist"></swiper>
    <iconlist :iconlist="iconList"></iconlist>
    <hot :top="top"></hot>
    <yourlike :likelist="likelist"></yourlike>
    <wekquna :weekendList="weekendList"></wekquna>
    <footers></footers>
  </div>
</template>
<script>
import QnHeader from "./components/Header";
import Swiper from "./components/swiper";
import axios from "axios";
import iconlist from "./components/iconlist";
import hot from "./components/hot";
import yourlike from "./components/yourlike";
import wekquna from "./components/wekquna";
import footers from "./components/footer";
export default {
  name: "Home",
  data() {
    return {
      swiperlist: [],
      iconList: [],
      top: [],
      likelist: [],
      weekendList: []
    };
  },
  components: { QnHeader, Swiper, iconlist, hot, yourlike, wekquna, footers },
  methods: {
    getHome() {
      axios.get("api/index.json").then(res => {
        var data = res.data;
        this.swiperlist = data.data.swiperList;
        this.iconList = data.data.iconList;
        this.top = data.data.recommendList;
        this.likelist = data.data.likelistone;
        this.weekendList = data.data.weekendList;
        console.log(data)
      })
    }
  },
  mounted() {
    this.getHome();
  }
};
</script>
